import React, { Component } from 'react'

class Toast extends Component {
  constructor(props) {
    super(props)
  }
  clearMsg() {
    this.props.clearMsg()
  }
  render() {
    return (
      <div className={this.props.msg ? 'modal-show modal' : 'modal'}>
        <div className="modal-dialog">
          <div className="modal-content">
            <div className="modal-header">
              <h4 className="modal-title text-center">提示</h4>
            </div>
            <div className="modal-body text-center" dangerouslySetInnerHTML={{__html: this.props.msg}}></div>
            <div className="modal-footer">
              <button onClick={this.clearMsg.bind(this)} className="btn btn-theme">确认</button>
            </div>
          </div>
        </div>
      </div>
    )
  }
}

export default Toast